<template>
  <!-- 放置一个图标 -->
  <div>
    <!-- 放置一个svg的图标 -->
    <svg-icon icon-class="fullscreen" style="color:#fff; width: 20px; height: 20px" @click="changeScreen" />
  </div>
</template>
<script>
import screenFull from 'screenfull'
export default {
  methods: {
    changeScreen() {
      if (!screenFull.enabled) {
        // 全屏api是存在兼容性问题
        this.$message.warning('全屏组件不可用')
        return
      }
      screenFull.toggle()
    }
  }
}
</script>
